<?php require_once("includes/security.php"); ?>	
<?php 
require_once("includes/initializeSession.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript" type="text/javascript" src="Script/jquery-1.9.1.js"></script>
  <script language="JavaScript" type="text/javascript" src="Script/jquery-ui-1.10.3.custom.js"></script>
  <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.10.3.custom.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />

<link rel="stylesheet" type="text/css" href="css/style.css">
<title>קליניקה נטורופתית</title>

</head>

<body>
<container id="container">
  <?php require("header.php"); ?>
      <content id="content">
      <contentTitle id="contentTitle">
      הצמחים והטיפולים שלנו
      </contentTitle>
      <contentText id="contentText">
<center>
<table id="delivry" border="1">
      <tr bgcolor="#FFFFFF">
    <td>שם פרטי</td>
    <td>שם משפחה</td>
    <td>מייל</td>
    <td>טלפון</td>
    <td>כתובת</td>
    <td>תאריך שליחה</td>
    <td>הערות</td>
    <td>שם מוצר</td>
    <td>תיאור מוצר</td>
    <td>מחיר מוצר</td>
  </tr>
  <?php 	
require("includes/openConnection.php");
$result = mysql_query("SELECT * FROM orders WHERE users_username='{$_SESSION['UserName']}'  AND  state=0 ORDER BY  created DESC ")or die (mysql_error());
if(mysql_num_rows($result) > 0)
{
			while($row = mysql_fetch_array($result))
			{	
		echo '<tr><td>'.$row['fn'].'</td>
    <td>'.$row['ln'].'</td>
    <td>'.$row['email'].'</td>
    <td>'.$row['phone'].'</td>
    <td>'.$row['address'].'</td>
    <td>'.$row['delivery'].'</td>
    <td>'.$row['note'].'</td>
    <td>'.$row['Pname'].'</td>
    <td>'.$row['Pdesc'].'</td>
    <td>'.$row['Pprice'].'</td></tr>';
			}
}

$result = mysql_query("SELECT SUM(Pprice) as tottal  FROM orders WHERE users_username='{$_SESSION['UserName']}'  AND  state=0 ORDER BY  created DESC ")or die (mysql_error());
if(mysql_num_rows($result) > 0)
{
			while($row = mysql_fetch_array($result))
			{	
		$TotalPrice= $row['tottal'];
    
			}
			echo " סך הכל לתשלום ".$TotalPrice;
}

require("includes/closeConnection.php");
?>
</table>
   
<script src=Script/paypal-button.min.js?merchant=gonaih@gmail.com 
    data-button=buynow 
    data-currency=ILS
    data-shipping=0
    data-tax=0
	data-amount="<?php echo $TotalPrice; ?>" 
></script>";

</contentText>
      </content>
</container>
    
     
    
</body>
</html>
